import request from '@/utils/request'; // 自定义的请求工具

export function getAllParkingGuidances() {
  return request({
    url: '/parkingGuidances',
    method: 'get'
  });
}

export function addParkingGuidance(data) {
  console.log("huiauhihiu",data)
  return request({
    url: '/parkingGuidances',
    method: 'post',
    data
  });
}

export function updateParkingGuidance(data) {
  return request({
    url: '/parkingGuidances',
    method: 'put',
    data
  });
}

export function deleteParkingGuidance(id) {
  return request({
    url: `/parkingGuidances/${id}`,
    method: 'delete'
  });
}
export function getParkingGuidanceById(id) {
    return request({
    url: `/parkingGuidances/${id}`,
    method: 'get'
    });
}
export function searchCarParks(keyword) {
  return request({
    url: '/parkingGuidances/list',
    method: 'get',
    params: { keyword }
  });
}


// 获取停车场总数
export function getTotalParkingLots() {
  return request({
    url: '/parkingGuidances/totalParkingLots',
    method: 'get'
  });
}

// 获取停车位利用率
export function getParkingSpaceUsageRate() {
  return request({
    url: '/parkingGuidances/parkingSpaceUsageRate',
    method: 'get'
  });
}

// 获取实时空余车位
export function getTimelyAvailableSpaces() {
  return request({
    url: '/parkingGuidances/timelyAvailableSpaces',
    method: 'get'
  });
}